package com.gzx.risk.core.service;

import java.util.concurrent.TimeUnit;

/**
 * @author hyuk
 */
public interface ILockControlService {

    /**
     * 默认15s
     * @param key
     * @return
     */
    boolean tryLock(String key);

    /**
     * 尝试获取锁
     *
     * @param lockKey
     * @param waitTime
     * @param unit
     * @return
     */
    boolean tryLock(String lockKey, long waitTime, TimeUnit unit);

    boolean tryDebounce(String key, long expireTime, TimeUnit timeUnit);

    /**
     * 释放锁
     *
     * @param lockKey
     */
    void unlock(String lockKey);


}
